#!/bin/bash

# Description: 辅助打印dmesg信息
# File: dmesg_helper.sh |Time: 2021-07-04 09:29

# 清除dmesg信息

clear
input=""
for (( ; ; )); do
    read -p "Enter to prient dmesg >>> " input

    if [[ $input == "q" ]]; then
        exit
    fi

    if [[ $input == "c" ]]; then
        clear
        continue
    fi

    if [[ $input == "h" ]]; then
        echo "直接回车打印dmesg信息"
        echo "h  打印帮助信息"
        echo "q  退出程序"
        echo "c  清屏"
        continue
    fi

    echo "=======dmesg==========="
    sudo dmesg
    sudo dmesg -C
done


